<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>选择器</title>
    <script type="text/javascript" src="../js/jquery-3.4.1.min.js"></script>
    <script>
        $(function(){
           $("#btn").click(function(){
                console.log($("#d1"));
                console.log($(".c1"));
                console.log($("div"));
                console.log($("*"));
           });
           $("#btn2").click(function(){
              console.log($("#d1,#d2"));
              console.log($("#d3 span"));
              console.log($("#d3>span"));
              console.log($("#d4+span"));
              console.log($("#d4~span"));
           });
        });
    </script>
</head>
<body>
<button id="btn">基本选择器</button><br/>
<button id="btn2">混合选择器</button><br/>
<hr/>
<div class="c1" id="d1">这是一个div</div>
<div class="c1" id="d2">这是一个div</div>
<div id="d3">
    <div>
        这是一个div
        <span>这是d3中的div中的span</span>
    </div>
    <span>这是d3中的span</span>
</div>
<div id="d4">这是d4</div>
<span>这是span</span>
<span>这是span</span>
<span>这是span</span>
</body>
</html>